import 'package:flutter/material.dart';
import 'package:flutter_app/components/radiusContainer.dart';

//市场研报
class ReportModule extends StatefulWidget {
  @override
  _ReportModuleState createState() => _ReportModuleState();
}

List<Widget> getReportModule() {
  return [1, 1, 1, 1].map((item) {
    return Container(
      width: 190,
      margin: const EdgeInsets.only(right: 15),
      padding: EdgeInsets.all(15.0),
      color: Colors.grey.withOpacity(0.06),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            '加密货币衍生品市场趋势分析',
            style: TextStyle(
                fontSize: 16,
                fontWeight: FontWeight.w500,
                color: Colors.black.withOpacity(0.7)),
          ),
          Text(
            '2020年8月',
            style: TextStyle(color: Colors.grey),
          )
        ],
      ),
    );
  }).toList();
}

class _ReportModuleState extends State<ReportModule> {
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(vertical: 10.0),
      child: RadiusContainer(
          radius: 5.0,
          child: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    '市场研报',
                    style: TextStyle(fontWeight: FontWeight.w500, fontSize: 17),
                  ),
                  Text(
                    '更多',
                    style: TextStyle(color: Colors.blueAccent, fontSize: 16),
                  )
                ],
              ),
              Container(
                height: 110,
                margin: EdgeInsets.only(top: 15),
                child: ListView(
                    scrollDirection: Axis.horizontal,
                    children: getReportModule()),
              )
            ],
          )),
    );
  }
}
